# -*- encoding=utf8 -*-
        
__author__ = "Bryan.Chen"
__desc__=""
        
from airtest.core.api import *
        
auto_setup(__file__)
        
from poco.drivers.std import StdPoco
poco = StdPoco()
        
using("../FlowTest.air")
import FlowTest
        
class GoldBean_EnterGame(FlowTest.BaseTestCase):
    def __init__(self):
        print("%s __init__" % (__file__))
        
    def runTest(self, args):
        print("%s runTest" % (__file__))

        # 先切换tab页
        btnGoldBean = poco("jifen_button")
        if not btnGoldBean.exists():
            return False
        self.clickButton(btnGoldBean)

        jdcLayer = poco("JDCLobbyPageLayer")
        gameItems = jdcLayer.offspring("AssetsUpdateNode")
        if len(gameItems) == 0:
            return False
        btnIcon = gameItems[0].offspring("game_btn")
        if not btnIcon.exists():
            return False
            
        self.clickButton(btnIcon)

        return True
        
_instance = GoldBean_EnterGame()
runTest = _instance.runTest
